<?php

namespace App\Http\Controllers\Agency;
use App\Http\Controllers\Controller;
use App\Models\Cms_Errmsg;
use App\Services\SystemService;
use Illuminate\Http\Request;
use hg\apidoc\annotation as Apidoc;

/**
 * 系统设置
 * @Apidoc\Group("behind")
 */
class SystemController extends Controller
{
    /**
     * @Apidoc\Title ("电子合同-认证企业列表")
     * @Apidoc\Url("/agency/agencyAuthList")
     * @Apidoc\Method("GET")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Returned("name",type="string",desc="公司名称")
     * @Apidoc\Returned("code",type="string",desc="统一信用代码")
     * @Apidoc\Returned("idcard",type="string",desc="法人身份证")
     * @Apidoc\Returned("mobile",type="string",desc="法人电话")
     * @Apidoc\Returned("contacts",type="string",desc="法人名称")
     *
     */
    public function agencyAuthList(SystemService $systemService , Request $request)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $list = $systemService->agencyAuthList($params);
        return $this->responseSuccess($list);
    }

    /**
     * @Apidoc\Title ("电子合同-添加签约企业")
     * @Apidoc\Url("/agency/agencyAuthAdd")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function agencyAuthAdd(SystemService $systemService , Request $request)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $systemService->agencyAuthAdd($params);
        if($result['status'])
            return $this->responseSuccess($result['status']);
        else
            return $this->responseError($result['code']);
    }

    public function agencyAuthNotify(SystemService $systemService ,Request $request)
    {
        $params = $request->input();
        $result = $systemService->agencyAuthNotify($params);
    }
}
